@import './theme/atom-one-dark.scss';
@import './theme/foundation.scss';
@import './theme/github.scss';
@import './theme/idea.scss';
@import './theme/intellij-light.scss';
@import './theme/stackoverflow-light';
@import './theme/vs2015';
@import './theme/xcode';
@import './theme/xnote-dark';
@import './theme/xnote-dark-blue';

@import '../../../assets/scroll';

.xnote-source-code code {
  padding: 0;
  border: none;
  background: none;
  border-radius: 0;
  vertical-align: inherit;
}

.xnote-source-code {
  position: relative;
  margin-top: 16px;
  margin-bottom: 16px;
}

.xnote-source-code-container {
  border-radius: 5px;
  line-height: 1.418em;
  display: flex;
  position: relative;
  overflow: hidden;

  &.xnote-source-code-auto-break .xnote-source-code-line {
    word-break: break-all;
    word-wrap: break-word;
    white-space: pre-wrap;
  }

}

code, kbd, pre, samp {
  font-family: Microsoft YaHei Mono, Menlo, Monaco, Consolas, Courier New, monospace;
}

.xnote-source-code-line-number-bg {
  background-color: inherit;
  //border-right: 1px solid #eee;
  width: 3em;
  display: none;
  position: relative;
  z-index: 2;
}

.xnote-source-code.xnote-source-code-line-number {
  .xnote-source-code-line-number-bg {
    display: block;
  }

  .xnote-source-code-line {
    margin-left: -4em;
  }
}

.xnote-source-code-content {
  flex: 1;
  padding: 15px 0 15px 0;
  counter-reset: codeNum;
  overflow: auto;
  position: relative;
  max-height: 450px;
  font-size: 15px;
  margin: 0;

  @include scroll();
}

.xnote-source-code-content-highlight .xnote-source-code-line {
  opacity: 0.36;
}

.xnote-source-code-line {
  display: flex;
  margin: 2px 0;
}

.xnote-source-code-line-content {
  padding: 0 20px;
  display: block;
}

.xnote-source-code-line-number {
  .xnote-source-code-line-content {
    padding: 0 20px 0 10px;
  }

  .xnote-source-code-line::before {
    counter-increment: codeNum;
    content: counter(codeNum);
    box-sizing: border-box;
    position: sticky;
    z-index: 2;
    left: 0;
    min-width: 4em;
    transform: translateX(-4em);
    text-align: right;
    padding-right: 10px;
    overflow: hidden;
    white-space: nowrap;
    opacity: .5;
  }
}

.xnote-source-code-content-highlight .xnote-source-code-line-emphasize {
  opacity: 1;
}

.xnote-source-code-lang {
  position: absolute;
  right: 0;
  top: 0;
  opacity: 0.5;
  pointer-events: none;
  font-size: 13px;
  padding: 4px 10px;
}
